package com.ssm.Dao;

import com.ssm.Utils.DBCPUtils;

import java.sql.ResultSet;
import java.sql.SQLException;

public class findListDao2 {

    public Object[] findL(String pic){

        String sql_cate="select * from category where c_picture=?";

        Object[] objects={pic};

        ResultSet resultSet3 = DBCPUtils.executeQuery(sql_cate, objects);
        Object[] objects1=null;
        try {
            while (resultSet3.next()){
                String c_name=resultSet3.getString("c_name");
                String c_type=resultSet3.getString("c_type");
                int c_count=resultSet3.getInt("c_count");
                int c_place=resultSet3.getInt("c_place");

                objects1=new Object[]{c_name,c_type,c_count,c_place};
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            //关闭数据库的方法
            DBCPUtils.closeAll(resultSet3, DBCPUtils.pstmt, DBCPUtils.connection);
        }

        return objects1;
    }
}
